const ENV = {
    "env_prod": {
        "REDIS_HOST": "prod.redis",
        "REDIS_PORT": "6379",
        "REDIS_PASS": "1234",
        "POSTGRES_HOST": "prod.postgres",
        "POSTGRES_PORT": "5432",
        "POSTGRES_USER": "postgres",
        "POSTGRES_PASS": "123456"
    },
    "env_test": {
        "REDIS_HOST": "test.redis",
        "REDIS_PORT": "6379",
        "REDIS_PASS": "1234",
        "POSTGRES_HOST": "test.postgres",
        "POSTGRES_PORT": "5432",
        "POSTGRES_USER": "postgres",
        "POSTGRES_PASS": "123456"
    },
    "env_dev": {
        "REDIS_HOST": "dev.redis",
        "REDIS_PORT": "6379",
        "REDIS_PASS": "1234",
        "POSTGRES_HOST": "dev.postgres",
        "POSTGRES_PORT": "5432",
        "POSTGRES_USER": "postgres",
        "POSTGRES_PASS": "123456"
    }
};

module.exports = {
    "apps": [
        {
            "name": "tsingxiao-cloud-code-generate",
            "script": "/usr/bin/java",
            "args": [
                "-Djava.security.egd=file:/dev/./urandom",
                "-jar",
                "tsingxiao-cloud-code-generate-api/target/tsingxiao-cloud-code-generate-api.jar"
            ],
            "exec_interpreter": "",
            "exec_mode": "fork",
            ...ENV
        },
    ],
    deploy: {
        prod: {
            host: ['192.168.99.110'],
            user: '<deploy_user>',
            ssh_options: "StrictHostKeyChecking=no",
            ref: '<your_branch>', // (use 'origin/master' for your master branch,
            repo: "git@gitee.com:<your_git_user>/<your_repo>.git", // your repo url
            path: "~/deploy/tsingxiao-cloud-code-generate",
            "post-deploy": "sh deploy.sh prod",
        },
        test: {
            host: ['192.168.99.110'],
            user: '<deploy_user>',
            ssh_options: "StrictHostKeyChecking=no",
            ref: '<your_branch>', // (use 'origin/master' for your master branch,
            repo: "git@gitee.com:<your_git_user>/<your_repo>.git", // your repo url
            path: "~/deploy/tsingxiao-cloud-code-generate",
            "post-deploy": "sh deploy.sh test",
        },
        dev: {
            host: ['192.168.99.110'],
            user: '<deploy_user>',
            ssh_options: "StrictHostKeyChecking=no",
            ref: '<your_branch>', // (use 'origin/master' for your master branch,
            repo: "git@gitee.com:<your_git_user>/<your_repo>.git", // your repo url
            path: "~/deploy/tsingxiao-cloud-code-generate",
            "post-deploy": "sh deploy.sh dev",
        }

    }
};
